package com.ym521.skeleton;

import android.view.View;
import android.widget.GridView;
import android.widget.ListView;

import androidx.annotation.LayoutRes;
import androidx.recyclerview.widget.RecyclerView;

import com.ym521.skeleton.core.BlockViewSkeletonScreen;
import com.ym521.skeleton.core.GridViewSkeletonScreen;
import com.ym521.skeleton.core.ListViewSkeletonScreen;
import com.ym521.skeleton.core.RecyclerViewSkeletonScreen;
import com.ym521.skeleton.core.ViewSkeletonScreen;

/**
 * @author Ym
 * E-mail: 2435970206@qq.com
 * createTime:2023/8/6
 * explain:
 */
public final class Skeleton {

    /**
     * RecyclerView 骨架屏
     *
     * @param view
     * @return
     */
    public static RecyclerViewSkeletonScreen.Builder bind(RecyclerView view) {
        return new RecyclerViewSkeletonScreen.Builder(view);
    }

    /**
     * listView 骨架屏
     *
     * @param view
     * @return
     */
    public static ListViewSkeletonScreen.Builder bind(ListView view) {
        return new ListViewSkeletonScreen.Builder(view);
    }

    /**
     * GridView 骨架屏
     *
     * @param view
     * @return
     */
    public static GridViewSkeletonScreen.Builder bind(GridView view) {
        return new GridViewSkeletonScreen.Builder(view);
    }

    /**
     * View 骨架屏
     *
     * @param view
     * @return
     */
    public static ViewSkeletonScreen.Builder bind(View view) {

        return new ViewSkeletonScreen.Builder(view);
    }

    /**
     * View 骨架屏
     *
     * @param view 正常根布局View
     * @param  skeletonLayoutResID 骨架屏根布局ID
     * @return
     */
    public static BlockViewSkeletonScreen.Builder bind(View view, @LayoutRes int skeletonLayoutResID) {

        return new BlockViewSkeletonScreen.Builder(view, skeletonLayoutResID);
    }

}
